// 监听 storage 里的某一个key更改
import { useEventListener } from './useEventListener';

export function useListenerStorage(key, callback) {
    function watchStorage(e) {
        if (e.key === key) callback(e);
    }

    useEventListener(window, 'storage', watchStorage);
}
